package resultGui;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class errorFrame extends JFrame {

	/**
	 * Launch the application.
	 */
	static JFrame frame = new JFrame();
	static JLabel errorLabel;

	public static void main(String[] args) {
		// new errorFrame();
	}

	/**
	 * Create the frame.
	 * 
	 * @param string
	 */
	public errorFrame() {
		frame.getContentPane().setLayout(null);

		// errorLabel = new JLabel(string);
		errorLabel.setBounds(143, 41, 111, 38);
		frame.getContentPane().add(errorLabel);

		JButton sureButton = new JButton("\u786E\u5B9A");
		sureButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				frame.dispose();
			}
		});
		sureButton.setBounds(130, 162, 93, 23);
		frame.setBounds(600, 200, 377, 285);
		frame.getContentPane().add(sureButton);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	public static void setMessage(String message) {
		errorLabel = new JLabel(message);
		new errorFrame();
	}

}
